package com.toman.JavaBean;


import java.io.Serializable;

/**
 * @Author: shaojx
 * @Date: 2018/8/29 16:37
 * @Description:
 */

public class PlanCompleteCount extends BaseCount  implements Serializable {
    private static final long serialVersionUID = 1L;

    private Long planId;
    /**派工数量*/
    private Long dispatchCount;
    /**未完工数量*/
    private Long unCompleteCount;

    public Long getPlanId() {
        return planId;
    }

    public void setPlanId(Long planId) {
        this.planId = planId;
    }

    public Long getDispatchCount() {
        return dispatchCount;
    }

    public void setDispatchCount(Long dispatchCount) {
        this.dispatchCount = dispatchCount;
    }

    public Long getUnCompleteCount() {
        return unCompleteCount;
    }

    public void setUnCompleteCount(Long unCompleteCount) {
        this.unCompleteCount = unCompleteCount;
    }

    @Override
    public void fillAllZero() {
        super.fillAllZero();
        this.unCompleteCount = 0L;
        this.dispatchCount = 0L;
    }

    @Override
    public void fillNull2Zero() {
        super.fillNull2Zero();
        if (this.dispatchCount == null) {
            this.dispatchCount = 0L;
        }
        if (this.unCompleteCount == 0L) {
            this.unCompleteCount = 0L;
        }
    }

    public void calcUnCompleteCount() {
        if (this.dispatchCount == null || this.getCompletedCount() == null) {
            this.unCompleteCount = 0L;
        } else {
            this.unCompleteCount = this.dispatchCount - this.getCompletedCount();
        }
    }

}
